package com.sdy.healthcode.biz.dto.schedule;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;
import java.util.Map;

@Data
@Accessors(chain = true)
@ApiModel("排班信息")
public class ScheduleSettings {
    @ApiModelProperty(value = "科室")
    private Integer dept;
    private List<ScheduleSettingsDay> settings;
    // len=7
    private Map<Integer, ScheduleSettingsDoctorDetail> doctors;

    public static final Integer DEFAULT_VISIT_NUM = 4;
    public static final String[] DAY_RANGE = {"上午", "下午"};
    public static final String[][] TIME_RANGE = {{"7:00~8:00", "8:00~9:00", "9:00~10:00", "10:00~11:00"}, {"13:00~14:00", "14:00~15:00"}};
    public static final String[] WEEK_Z_STR_2 = {"周一", "周二", "周三", "周四", "周五", "周六", "周日"};

    @Data
    @Accessors(chain = true)
    @ApiModel("一天排班信息")
    public static class ScheduleSettingsDay {
        // len=2
        private List<ScheduleSettingsDayItem> settingDay;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("半天排班信息")
    public static class ScheduleSettingsDayItem {
        // len=doctor.len
        private List<ScheduleSettingsDoctor> doctors;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("排班医生详情")
    public static class ScheduleSettingsDoctorDetail {
        @ApiModelProperty(value = "姓名")
        private String name;
        @ApiModelProperty(value = "医生ID")
        private Integer doctorId;
        @ApiModelProperty(value = "状态 1-正常 2-停诊", allowableValues = "1,2")
        private Integer state;
        @ApiModelProperty(value = "头像")
        private String avatar;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("排班医生信息")
    public static class ScheduleSettingsDoctor {
        @ApiModelProperty(value = "医生ID")
        private Integer doctorId;
        @ApiModelProperty(value = "是否已排班")
        private Boolean checked;
        @ApiModelProperty(value = "特殊月分设置")
        private Boolean special;
        @ApiModelProperty(value = "上班月份")
        private List<Integer> months;
        private List<ScheduleSettingsDoctorVisit> visits;
    }

    @Data
    @Accessors(chain = true)
    @ApiModel("医生排班时段")
    public static class ScheduleSettingsDoctorVisit {
        @ApiModelProperty(value = "时间段")
        private String time;
        @ApiModelProperty(value = "预约数量")
        private Integer num;
        @ApiModelProperty(value = "是否选中")
        private Boolean checked;
    }
}
